package service

import (
	"ginfast/pkg/ctx"
	"ginfast/pkg/orm"

	"github.com/gin-gonic/gin"
	"gorm.io/gorm"
)

func Clear(v interface{}, c *gin.Context) {
	orm.DB().Session(&gorm.Session{AllowGlobalUpdate: true}).Delete(v)
	ctx.JSONWriteData(nil, c)
}
